package leistungsbewertungTRY2;


public class Event {
	
	private int tic = new Fields().tic;
	
	

	public Event() {
		super();
	}

	private void schlafen() {
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}

	}
	
	public void customerArrival(Customer c) {
		while (c.getArrivalTime() - tic > 0) {
			schlafen();
			c.setArrivalTime(c.getArrivalTime() - tic);
//			System.out.println(c.getArrivalTime());
		}
		Schlange.q.add(c);
	}

	public void serviceCompletion(Customer c) {
		while (c.getCompletionTime() - tic > 0) {
			c.setCompletionTime(c.getCompletionTime() - tic);
//			System.out.println(c.getCompletionTime());
		}
		Schlange.q.remove(c);
	}

	public void simulationTermination() {
		System.out.println(" S Y S T E M T E R M I N A T I O N B O Y S");

	}
	

}
